<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateMarketingShopAdvertise extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('marketing_shop_advertisement', function (Blueprint $table) {
            $table->id();
            $table->string('title',60)->default('')->comment('标题');
            $table->tinyInteger('status')->default(0)->comment('启用:0-禁用,1-启用');
            $table->tinyInteger('type')->default(1)->comment('广告类型:1-开屏广告');
            $table->tinyInteger('channel')->default(0)->comment('投放渠道');
            $table->tinyInteger('jumpStatus')->default(1)->comment('开屏广告-是否可跳过广告:0-否,1-是');
            $table->unsignedInteger('cutDown')->default(0)->comment('开屏广告-倒计时s');
            $table->tinyInteger('showRule')->default(0)->comment('规则,见model');
            $table->tinyInteger('shopScope')->default(0)->comment('门店范围:0-部分,1-全部');
            $table->tinyInteger('notLoginShow')->default(0)->comment('未登录显示:0-不限时，1-显示');
            $table->tinyInteger('jumpType')->default(1)->comment('跳转类型见model');
            $table->unsignedInteger('jumpRelId')->default(0)->comment('跳转关联ID');
            $table->tinyInteger('jumpBtnShow')->default(1)->comment('跳转按钮展示:0-不展示,1-展示');
            $table->string('jumpLink')->default('')->comment('跳转链接');
            $table->unsignedInteger('startAt')->default(0)->comment('开始时间');
            $table->unsignedInteger('endAt')->default(0)->comment('结束时间');



            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除 0 否 1是');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '门店广告配置';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('marketing_shop_advertise');
    }
}
